//
//  SpecialMoreTableViewCell.m
//  B项目
//
//  Created by lanou on 15/12/21.
//  Copyright © 2015年 tzf. All rights reserved.
//

#import "SpecialMoreTableViewCell.h"

@implementation SpecialMoreTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        _imageV = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, kWidth - 10, (kWidth - 10) * 49 / 100 - 5)];
        _imageV.layer.cornerRadius = 5;
        _imageV.layer.masksToBounds = YES;
        
        
        _titleLbel = [[UILabel alloc] initWithFrame:(CGRectMake(0, 0, kWidth, _imageV.frame.size.height / 9.0))];
        _titleLbel.center = CGPointMake(_imageV.center.x, _imageV.center.y - (kWidth - 10) * 49 / 100 / 9.0);;

        UILabel *xian = [[UILabel alloc] initWithFrame:(CGRectMake(0, 0, kWidth, _imageV.frame.size.height / 9.0))];
        xian.text = @"∙";
        xian.center = _imageV.center;
        
        _subtitleLbel = [[UILabel alloc] initWithFrame:(CGRectMake(0, 0, kWidth, _imageV.frame.size.height / 9.0))];
        _subtitleLbel.center = CGPointMake(_imageV.center.x, _imageV.center.y + _imageV.frame.size.height / 9.0);
        
        UIView *view = [[UIView alloc] init];
        view.frame = _imageV.frame;
        view.backgroundColor = [UIColor darkGrayColor];
        view.alpha = 0.3;
        view.layer.cornerRadius = 5;
        view.layer.masksToBounds = YES;
        
        
        
        
        [self addSubview:_imageV];
        [self addSubview:view];
        [self addSubview:_titleLbel];
        [self addSubview:xian];
        [self addSubview:_subtitleLbel];
        
        xian.textColor = [UIColor whiteColor];
        _titleLbel.textColor = [UIColor whiteColor];
        _subtitleLbel.textColor = [UIColor whiteColor];
        
        _subtitleLbel.textAlignment = NSTextAlignmentCenter;
        _titleLbel.textAlignment = NSTextAlignmentCenter;
        xian.textAlignment = NSTextAlignmentCenter;
    }
    return self;
}




-(void)setModel:(SpecialModel *)model
{
    _model = model;
    _titleLbel.text = model.title;
    _subtitleLbel.text = model.subtitle;
    _imageV.image = [UIImage imageNamed:@"zhanweipic.png"];
    NSURL *url = [NSURL URLWithString:model.cover_image_url];
    [_imageV sd_setImageWithURL:url];
    
}











@end
